package chan.project.smartlawcommon.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

@Configuration
public class KafkaTopicConfig {

    public static final String LEGAL_TOPIC = "legal-topic";
    public static final String INSTRUMENT_TOPIC = "instrument-topic";

    @Bean
    public NewTopic legalTopic() {
        return TopicBuilder.name(LEGAL_TOPIC)
                .partitions(1)
                .replicas(1)
                .build();
    }

    @Bean
    public NewTopic instrumentTopic() {
        return TopicBuilder.name(INSTRUMENT_TOPIC)
                .partitions(1)
                .replicas(1)
                .build();
    }
}